package com.linkwechat.wecom.service.impl;

import com.linkwechat.wecom.domain.WeworkKfAccount;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.linkwechat.wecom.mapper.WeworkKfAccountMapper;
import com.linkwechat.wecom.service.IWeworkKfAccountService;

import java.util.List;

/**
 * 企微客服账号Service业务层处理
 *
 * @author ruoyi
 * @date 2022-02-17
 */
@Service
public class WeworkKfAccountServiceImpl extends ServiceImpl<WeworkKfAccountMapper, WeworkKfAccount> implements IWeworkKfAccountService {

    @Override
    public List<WeworkKfAccount> queryList(WeworkKfAccount weworkKfAccount) {
        LambdaQueryWrapper<WeworkKfAccount> lqw = Wrappers.lambdaQuery();
        if (weworkKfAccount.getId() != null){
            lqw.eq(WeworkKfAccount::getId , weworkKfAccount.getId());
        }
        if (weworkKfAccount.getOpenKfid() != null){
            lqw.eq(WeworkKfAccount::getOpenKfid , weworkKfAccount.getOpenKfid());
        }
        if (weworkKfAccount.getCreateTime() != null){
            lqw.eq(WeworkKfAccount::getCreateTime , weworkKfAccount.getCreateTime());
        }
        if (weworkKfAccount.getServiceNum() != null){
            lqw.eq(WeworkKfAccount::getServiceNum , weworkKfAccount.getServiceNum());
        }
//        if (StringUtils.isNotBlank(weworkKfAccount.getTenantCode())){
//            lqw.eq(WeworkKfAccount::getTenantCode ,weworkKfAccount.getTenantCode());
//        }
        return this.list(lqw);
    }
}
